<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->


<title>What Goes Up</title>
<meta name="description" content="What Goes Up">
<meta name="keywords" content="htmlatex">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<link rel="STYLESHEET" href="acm-00481_archivos/htmlatex.css">
</head><body bgcolor="#ffffff" lang="EN">
 <h1><br clear="ALL"><center><table bgcolor="#0060f0"><tbody><tr><td><b><font color="#c0ffff" size="5">&nbsp;<a name="SECTION0001000000000000000000">What Goes Up</a></font>&nbsp;</b></td></tr></tbody></table></center></h1>
<p>
Write a program that will select the longest <em>strictly</em> increasing subsequence from a sequence of integers.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001001000000000000000">Input</a></font></h2>
<p>
The input file will contain a sequence of integers (positive, negative, and/or zero). Each line of the
input file will contain one integer.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001002000000000000000">Output</a></font></h2>
<p>
The output for this program will be a line indicating the length of the longest subsequence, a newline, a dash character ('<tt>-</tt>'),
a newline, and then the subsequence itself printed with one integer per
line. If the input contains more than one longest subsequence, the
output file should print the one that occurs last in the input file.
</p><p>
</p><p>
Notice that the second 8 was not included -- the subsequence must be strictly increasing.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001003000000000000000">Sample Input</a></font></h2>
<p>
</p><pre>-7
10
9
2
3
8
8
1</pre>
<p>
</p><h2><font color="#0070e8"><a name="SECTION0001004000000000000000">Sample Output</a></font></h2>
<p>
</p><pre>4
-
-7
2
3
8</pre>
<p>
</p></body></html>